package com.TestDemo;

public class TestReturn {
    public String name;
    public int age;
    public static String name1;
    public static void main(String[] args) {
        String namem = null;
        int agem = 0;

        TestReturn testReturn = new TestReturn();
        System.out.println("对象调用有static的name--"+testReturn.name1);
        System.out.println("method start：");
        testReturn.Method1(6);  // test: if a > 5 break; a < 5; run out


        System.out.println();
        System.out.println("method end;");
        System.out.println("没static的name--"+testReturn.name);
        System.out.println("对象调用有static的name--"+testReturn.name1);
        System.out.println("有static的name--"+name1);
        System.out.println("static的name--"+namem);
        System.out.println("static的name--"+agem);
    }


    public void Method1(int a){
        this.name1 = "哈哈";
        System.out.println("Method1有static的name--"+this.name1);
        age = a;
        if(a>5){
            System.out.println("age:" + age);
            System.out.println("有static的name--"+name1);
            return;
        }
        System.out.println("method1的输出》");
    }

    public static void Method2(int a){

        if(a>5){

            System.out.println("有static的name--"+name1);
            return;
        }
        System.out.println("method1的输出》");
    }
}
